<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>VuePress 搭建博客（一）vuepress-theme-reco 主题博客初始化 | 避海拦天的学习笔记</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="./favicon.ico">
    <meta name="description" content="BHLT's Blog">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    
    <link rel="preload" href="./assets/css/0.styles.4e303abf.css" as="style"><link rel="preload" href="./assets/js/app.eeeee38d.js" as="script"><link rel="preload" href="./assets/js/3.58d0d062.js" as="script"><link rel="preload" href="./assets/js/1.cb177be2.js" as="script"><link rel="preload" href="./assets/js/12.a8ba3e88.js" as="script"><link rel="prefetch" href="./assets/js/10.3c746082.js"><link rel="prefetch" href="./assets/js/11.d2d08f8b.js"><link rel="prefetch" href="./assets/js/13.feb89dc4.js"><link rel="prefetch" href="./assets/js/14.9c823496.js"><link rel="prefetch" href="./assets/js/4.f0d67def.js"><link rel="prefetch" href="./assets/js/5.66d75df3.js"><link rel="prefetch" href="./assets/js/6.4f9c83c7.js"><link rel="prefetch" href="./assets/js/7.d6c7b755.js"><link rel="prefetch" href="./assets/js/8.eccec34b.js"><link rel="prefetch" href="./assets/js/9.bbf5ffc8.js">
    <link rel="stylesheet" href="./assets/css/0.styles.4e303abf.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container no-sidebar" data-v-1aefc0b4><div data-v-1aefc0b4><div id="loader-wrapper" class="loading-wrapper" data-v-d48f4d20 data-v-1aefc0b4 data-v-1aefc0b4><div class="loader-main" data-v-d48f4d20><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div></div> <!----> <!----></div> <div class="password-shadow password-wrapper-out" style="display:none;" data-v-25ba6db2 data-v-1aefc0b4 data-v-1aefc0b4><h3 class="title" data-v-25ba6db2 data-v-25ba6db2>避海拦天的学习笔记</h3> <p class="description" data-v-25ba6db2 data-v-25ba6db2>BHLT's Blog</p> <label id="box" class="inputBox" data-v-25ba6db2 data-v-25ba6db2><input type="password" value="" data-v-25ba6db2> <span data-v-25ba6db2>Konck! Knock!</span> <button data-v-25ba6db2>OK</button></label> <div class="footer" data-v-25ba6db2 data-v-25ba6db2><span data-v-25ba6db2><i class="iconfont reco-theme" data-v-25ba6db2></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-25ba6db2>vuePress-theme-reco</a></span> <span data-v-25ba6db2><i class="iconfont reco-copyright" data-v-25ba6db2></i> <a data-v-25ba6db2><span data-v-25ba6db2>避海拦天</span>
            
          <span data-v-25ba6db2>2022 - </span>
          2023
        </a></span></div></div> <div class="hide" data-v-1aefc0b4><header class="navbar" data-v-1aefc0b4><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/./" class="home-link router-link-active"><img src="./bhlt.png" alt="避海拦天的学习笔记" class="logo"> <span class="site-name">避海拦天的学习笔记</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/./" class="nav-link"><i class="iconfont reco-home"></i>
  主页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/./categories/实用工具/" class="nav-link"><i class="undefined"></i>
  实用工具
</a></li><li class="dropdown-item"><!----> <a href="/./categories/网站搭建/" class="nav-link"><i class="undefined"></i>
  网站搭建
</a></li><li class="dropdown-item"><!----> <a href="/./categories/随笔/" class="nav-link"><i class="undefined"></i>
  随笔
</a></li></ul></div></div><div class="nav-item"><a href="/./tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/./timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间轴
</a></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-1aefc0b4></div> <aside class="sidebar" data-v-1aefc0b4><div class="personal-info-wrapper" data-v-39576ba9 data-v-1aefc0b4><img src="./avatar.png" alt="author-avatar" class="personal-img" data-v-39576ba9> <h3 class="name" data-v-39576ba9>
    避海拦天
  </h3> <div class="num" data-v-39576ba9><div data-v-39576ba9><h3 data-v-39576ba9>4</h3> <h6 data-v-39576ba9>文章</h6></div> <div data-v-39576ba9><h3 data-v-39576ba9>8</h3> <h6 data-v-39576ba9>标签</h6></div></div> <ul class="social-links" data-v-39576ba9></ul> <hr data-v-39576ba9></div> <nav class="nav-links"><div class="nav-item"><a href="/./" class="nav-link"><i class="iconfont reco-home"></i>
  主页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/./categories/实用工具/" class="nav-link"><i class="undefined"></i>
  实用工具
</a></li><li class="dropdown-item"><!----> <a href="/./categories/网站搭建/" class="nav-link"><i class="undefined"></i>
  网站搭建
</a></li><li class="dropdown-item"><!----> <a href="/./categories/随笔/" class="nav-link"><i class="undefined"></i>
  随笔
</a></li></ul></div></div><div class="nav-item"><a href="/./tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><a href="/./timeline/" class="nav-link"><i class="iconfont reco-date"></i>
  时间轴
</a></div> <!----></nav> <!----> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-25ba6db2 data-v-1aefc0b4><h3 class="title" data-v-25ba6db2 data-v-25ba6db2>VuePress 搭建博客（一）vuepress-theme-reco 主题博客初始化</h3> <!----> <label id="box" class="inputBox" data-v-25ba6db2 data-v-25ba6db2><input type="password" value="" data-v-25ba6db2> <span data-v-25ba6db2>Konck! Knock!</span> <button data-v-25ba6db2>OK</button></label> <div class="footer" data-v-25ba6db2 data-v-25ba6db2><span data-v-25ba6db2><i class="iconfont reco-theme" data-v-25ba6db2></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-25ba6db2>vuePress-theme-reco</a></span> <span data-v-25ba6db2><i class="iconfont reco-copyright" data-v-25ba6db2></i> <a data-v-25ba6db2><span data-v-25ba6db2>避海拦天</span>
            
          <span data-v-25ba6db2>2022 - </span>
          2023
        </a></span></div></div> <div data-v-1aefc0b4><main class="page"><section><div class="page-title"><h1 class="title">VuePress 搭建博客（一）vuepress-theme-reco 主题博客初始化</h1> <div data-v-f875f3fc><i class="iconfont reco-account" data-v-f875f3fc><span data-v-f875f3fc>避海拦天</span></i> <i class="iconfont reco-date" data-v-f875f3fc><span data-v-f875f3fc>2022/3/19</span></i> <i class="iconfont reco-eye" data-v-f875f3fc><span id="./blogs/wang-zhan-da-jian/2022/da-jian-bo-ke-yi.html" data-flag-title="Your Article Title" class="leancloud-visitors" data-v-f875f3fc><a class="leancloud-visitors-count" style="font-size:.9rem;font-weight:normal;color:#999;"></a></span></i> <i class="tags iconfont reco-tag" data-v-f875f3fc><span class="tag-item" data-v-f875f3fc>VuePress</span><span class="tag-item" data-v-f875f3fc>vuepress-theme-reco</span><span class="tag-item" data-v-f875f3fc>博客搭建</span></i></div></div> <div class="theme-reco-content content__default"><blockquote><p>VuePress 是一款 Vue 驱动的静态网站生成器，以 Markdown 为中心的项目结构，以最少的配置帮助你专注于写作。</p> <p>vuepress-theme-reco 是一款简洁而优雅的 vuepress 博客&amp;文档主题。</p></blockquote> <p>效果：</p> <p><img src="./assets/img/image-20220319213014072.f7dc23ef.png" alt="image-20220319213014072"></p> <h2 id="零、准备工作"><a href="#零、准备工作" class="header-anchor">#</a> 零、准备工作</h2> <ol><li><p>安装 Yarn</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">npm</span> <span class="token function">install</span> --global <span class="token function">yarn</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>如果报错，需要用管理员权限</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> <span class="token function">npm</span> <span class="token function">install</span> --global <span class="token function">yarn</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>安装后检查是否安装成功</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">yarn</span> --version
<span class="token number">1.22</span>.18
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>如果没有Yarn，也可以用npm或者npx等其他包管理器，但是VuePress官网推荐使用Yarn来安装，因为在一些情况下，npm会生成错误的依赖树，在后期想要给网站添加一些插件的时候会出现错误。</p></li> <li><p>下载 vuepress-reco/theme-cli</p> <p>新建一个空项目目录<code>Blog</code>(起什么名字随意)</p> <p>在空目录下运行命令，初始化包管理器。</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">yarn</span> init <span class="token comment">#或 yarn init -y 默认所有选项为yes</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>在目录下运行命令，将VuePress、vuepress-reco/theme-cli 安装为本地依赖。很多教程使用的命令是带有<code>--global</code>的全局安装，但是VuePress官网已经不再推荐使用全局安装了，所以使用<code>-D</code>在目录本地安装。</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">yarn</span> <span class="token function">add</span> -D @vuepress-reco/theme-cli
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>安装后目录下会自动生成一个<code>node_modules</code>文件夹和两个文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>node_modules  package.json  yarn.lock
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li></ol> <h2 id="一、初始化博客"><a href="#一、初始化博客" class="header-anchor">#</a> 一、初始化博客</h2> <ol><li><p>使用 theme-cli初始化博客文件</p> <p>在<code>Blog</code>目录下运行初始化命令<code>yarn theme-cli init</code></p> <p>会出现很多初始化的问题，可以全回车跳过，之后再配置，也可以根据问题输入想要的配置。建议大家直接跳过，先把项目跑起来之后，可以慢慢修改。</p> <p>问题1 是否新建一个文件夹，我选择的是No。如果选择Yes 下个问题会问你新文件夹的名称。</p> <p>问题2 项目的标题（可回车直接跳过）</p> <p>问题3 项目的描述 （可回车直接跳过）</p> <p>问题4 作者的名字 （可回车直接跳过）</p> <p>问题5 你想要主页是什么风格的，有blog/doc/2.x三个选项，选择blog博客风格，如果做的是文档可以选择doc风格，2.x是个alpha的全新版本，也可以尝鲜。这里我选择的是blog。选择之后会开始下载模板文件，稍等一会儿。</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">yarn</span> theme-cli init
<span class="token function">yarn</span> run v1.22.18
warning package.json: No license field
? Whether to create a new directory? No
? What<span class="token string">'s the title of your project? 
? What'</span>s the description of your project? 
? What<span class="token string">'s the author'</span>s name? 
? What style <span class="token keyword">do</span> you want your home page to be?<span class="token punctuation">(</span>The <span class="token number">2</span>.x version is the alpha vers
ion<span class="token punctuation">)</span> <span class="token punctuation">(</span>Use arrow keys<span class="token punctuation">)</span>
❯ blog 
  doc 
  <span class="token number">2</span>.x 
✔ <span class="token punctuation">[</span><span class="token number">1</span>/3<span class="token punctuation">]</span> Load <span class="token function">file</span> from <span class="token function">git</span>
✔ <span class="token punctuation">[</span><span class="token number">2</span>/3<span class="token punctuation">]</span> Edit config.js
✔ <span class="token punctuation">[</span><span class="token number">3</span>/3<span class="token punctuation">]</span> Edit package.json

Load successful, enjoy it<span class="token operator">!</span>

<span class="token comment"># Install package</span>
$ <span class="token function">yarn</span> <span class="token operator">&amp;</span> <span class="token function">npm</span> <span class="token function">install</span>
Done <span class="token keyword">in</span> <span class="token number">40</span>.83s.
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br></div></div><p>初始化结束后，目录下会多出一个<code>blogs</code>文件夹，用来存放你的博客文章，<code>docs</code>文件夹存放文档类文章，<code>.vuepress</code>文件夹，存放博客的配置文件，图标背景图片等资源。<code>README.md</code>文件，是你的博客主页。如果看不到<code>.vuepress</code>文件夹，在文件夹设置中打开“显示隐藏文件”。</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>blogs  .gitignore    package.json  .vuepress
docs   node_modules  README.md     yarn.lock
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></li> <li><p>安装需要的Package</p> <p>在<code>Blog</code>目录下直接运行命令</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">yarn</span> <span class="token function">install</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>或</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">npm</span> <span class="token function">install</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li></ol> <h2 id="二、-看看效果"><a href="#二、-看看效果" class="header-anchor">#</a> 二、 看看效果</h2> <ol><li><p>在<code>Blog</code>目录下运行命令</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">yarn</span> dev
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>等待一会后会出现进度条，结束后会出现成功的提示</p> <p>在浏览器中打开 http://localhost:8080/ (如果端口被占用会变成8081或8082依次往上) <img src="./assets/img/image-20220319213014072.f7dc23ef.png" alt="image-20220319213014072"></p></li></ol> <h2 id="三、-自定义网站配置"><a href="#三、-自定义网站配置" class="header-anchor">#</a> 三、 自定义网站配置</h2> <ol><li><p>打开<code>.vuepress/config.js</code>在此文件下，可以修改网站的一些配置。不想要的部分可以直接删掉。</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code>module.exports = <span class="token punctuation">{</span>
  <span class="token property">&quot;title&quot;</span><span class="token operator">:</span> <span class="token string">&quot;避海拦天的学习笔记&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 博客网站的标题</span>
  <span class="token property">&quot;description&quot;</span><span class="token operator">:</span> <span class="token string">&quot;BHLT's Blog&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 博客网站的描述</span>
  <span class="token property">&quot;dest&quot;</span><span class="token operator">:</span> <span class="token string">&quot;public&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 打包生成文件的路径</span>
  <span class="token property">&quot;head&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
    <span class="token punctuation">[</span>
      <span class="token string">&quot;link&quot;</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span>
        <span class="token property">&quot;rel&quot;</span><span class="token operator">:</span> <span class="token string">&quot;icon&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;href&quot;</span><span class="token operator">:</span> <span class="token string">&quot;/favicon.ico&quot;</span> <span class="token comment">// favicon图标，在/.vuepress/public目录下</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">[</span>
      <span class="token string">&quot;meta&quot;</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span>
        <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;viewport&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;content&quot;</span><span class="token operator">:</span> <span class="token string">&quot;width=device-width,initial-scale=1,user-scalable=no&quot;</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
  <span class="token punctuation">]</span><span class="token punctuation">,</span>
  <span class="token property">&quot;theme&quot;</span><span class="token operator">:</span> <span class="token string">&quot;reco&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 使用的主题</span>
  <span class="token property">&quot;themeConfig&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token comment">// 主题配置</span>
    <span class="token property">&quot;nav&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span>
        <span class="token property">&quot;text&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Home&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;link&quot;</span><span class="token operator">:</span> <span class="token string">&quot;/&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;icon&quot;</span><span class="token operator">:</span> <span class="token string">&quot;reco-home&quot;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span>
        <span class="token property">&quot;text&quot;</span><span class="token operator">:</span> <span class="token string">&quot;TimeLine&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;link&quot;</span><span class="token operator">:</span> <span class="token string">&quot;/timeline/&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;icon&quot;</span><span class="token operator">:</span> <span class="token string">&quot;reco-date&quot;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span>
        <span class="token property">&quot;text&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Docs&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;icon&quot;</span><span class="token operator">:</span> <span class="token string">&quot;reco-message&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;items&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
          <span class="token punctuation">{</span>
            <span class="token property">&quot;text&quot;</span><span class="token operator">:</span> <span class="token string">&quot;vuepress-reco&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;link&quot;</span><span class="token operator">:</span> <span class="token string">&quot;/docs/theme-reco/&quot;</span>
          <span class="token punctuation">}</span>
        <span class="token punctuation">]</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span>
        <span class="token property">&quot;text&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Contact&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;icon&quot;</span><span class="token operator">:</span> <span class="token string">&quot;reco-message&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;items&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
          <span class="token punctuation">{</span>
            <span class="token property">&quot;text&quot;</span><span class="token operator">:</span> <span class="token string">&quot;GitHub&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;link&quot;</span><span class="token operator">:</span> <span class="token string">&quot;https://github.com/recoluan&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;icon&quot;</span><span class="token operator">:</span> <span class="token string">&quot;reco-github&quot;</span>
          <span class="token punctuation">}</span>
        <span class="token punctuation">]</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token property">&quot;sidebar&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
      <span class="token property">&quot;/docs/theme-reco/&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;theme&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;plugin&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;api&quot;</span>
      <span class="token punctuation">]</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">&quot;type&quot;</span><span class="token operator">:</span> <span class="token string">&quot;blog&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;blogConfig&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
      <span class="token property">&quot;category&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">&quot;location&quot;</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>
        <span class="token property">&quot;text&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Category&quot;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token property">&quot;tag&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">&quot;location&quot;</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>
        <span class="token property">&quot;text&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Tag&quot;</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token property">&quot;friendLink&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token comment">// 友情链接</span>
      <span class="token punctuation">{</span>
        <span class="token property">&quot;title&quot;</span><span class="token operator">:</span> <span class="token string">&quot;午后南杂&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;desc&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Enjoy when you can, and endure when you must.&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;email&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1156743527@qq.com&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;link&quot;</span><span class="token operator">:</span> <span class="token string">&quot;https://www.recoluan.com&quot;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span>
        <span class="token property">&quot;title&quot;</span><span class="token operator">:</span> <span class="token string">&quot;vuepress-theme-reco&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;desc&quot;</span><span class="token operator">:</span> <span class="token string">&quot;A simple and beautiful vuepress Blog &amp; Doc theme.&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;avatar&quot;</span><span class="token operator">:</span> <span class="token string">&quot;https://vuepress-theme-reco.recoluan.com/icon_vuepress_reco.png&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;link&quot;</span><span class="token operator">:</span> <span class="token string">&quot;https://vuepress-theme-reco.recoluan.com&quot;</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token property">&quot;logo&quot;</span><span class="token operator">:</span> <span class="token string">&quot;/logo.png&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 网站左上角的Logo图片，存放在/.vuepress/public目录下</span>
    <span class="token property">&quot;search&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 是否开启搜索功能</span>
    <span class="token property">&quot;searchMaxSuggestions&quot;</span><span class="token operator">:</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token comment">//搜索给出的最大建议条数</span>
    <span class="token property">&quot;lastUpdated&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Last Updated&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 最后更新时间</span>
    <span class="token property">&quot;author&quot;</span><span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 网站作者</span>
    <span class="token property">&quot;authorAvatar&quot;</span><span class="token operator">:</span> <span class="token string">&quot;/avatar.png&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;record&quot;</span><span class="token operator">:</span> <span class="token string">&quot;xxxx&quot;</span><span class="token punctuation">,</span> <span class="token comment">// 备案信息</span>
    <span class="token property">&quot;startYear&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2017&quot;</span> <span class="token comment">// 网站始于xxxx年</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token property">&quot;markdown&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token property">&quot;lineNumbers&quot;</span><span class="token operator">:</span> <span class="token boolean">true</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br><span class="line-number">97</span><br><span class="line-number">98</span><br><span class="line-number">99</span><br><span class="line-number">100</span><br><span class="line-number">101</span><br></div></div></li></ol> <h2 id="四、自定义首页配置"><a href="#四、自定义首页配置" class="header-anchor">#</a> 四、自定义首页配置</h2> <ol><li><p>打开<code>Blog</code>目录下的<code>README.md</code>对首页的配置进行更改。</p></li> <li><div class="language-markdown line-numbers-mode"><pre class="language-markdown"><code><span class="token front-matter-block"><span class="token punctuation">---</span>
<span class="token front-matter yaml language-yaml">home: true
heroText: 避海拦天的学习笔记 # 展示在主页正中的标题
tagline: Things change, roll with it. # 展示在标题下方的文字
# heroImage: /hero.png
# heroImageStyle: {
#   maxWidth: '600px',
#   width: '100%',
#   display: block,
#   margin: '9rem auto 2rem',
#   background: '#fff',
#   borderRadius: '1rem',
# }
# 主页背景图
bgImage: /bg.jpg # 设置背景图片，图片放在/.vuepress/public目录下
bgImageStyle: {
  height: '300px' # 背景图高度
}
isShowTitleInHome: false
actionText: Guide
actionLink: /views/other/guide
features:
- title: Yesterday
  details: 开发一款看着开心、写着顺手的 vuepress 博客主题
- title: Today
  details: 希望帮助更多的人花更多的时间在内容创作上，而不是博客搭建上
- title: Tomorrow
  details: 希望更多的爱好者能够参与进来，帮助这个主题更好的成长</span>
<span class="token punctuation">---</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br></div></div></li> <li><p>修改保存后可以重新运行<code>yarn dev</code>查看效果。</p></li></ol> <h2 id="参考资料"><a href="#参考资料" class="header-anchor">#</a> 参考资料</h2> <ul><li><p><a href="https://vuepress.vuejs.org/zh/" target="_blank" rel="noopener noreferrer">VuePress官网<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p></li> <li><p><a href="https://vuepress-theme-reco.recoluan.com/" target="_blank" rel="noopener noreferrer">vuepress-theme-reco主题官网<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p></li></ul></div></section> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新: </span> <span class="time">2022/4/11 19:17:32</span></div></footer> <!----> <div class="comments-wrapper"><!----></div> <ul class="side-bar sub-sidebar-wrapper" style="width:12rem;" data-v-cb1513f6><li class="level-2" data-v-cb1513f6><a href="/./blogs/wang-zhan-da-jian/2022/da-jian-bo-ke-yi.html#零、准备工作" class="sidebar-link reco-side-零、准备工作" data-v-cb1513f6>零、准备工作</a></li><li class="level-2" data-v-cb1513f6><a href="/./blogs/wang-zhan-da-jian/2022/da-jian-bo-ke-yi.html#一、初始化博客" class="sidebar-link reco-side-一、初始化博客" data-v-cb1513f6>一、初始化博客</a></li><li class="level-2" data-v-cb1513f6><a href="/./blogs/wang-zhan-da-jian/2022/da-jian-bo-ke-yi.html#二、-看看效果" class="sidebar-link reco-side-二、-看看效果" data-v-cb1513f6>二、 看看效果</a></li><li class="level-2" data-v-cb1513f6><a href="/./blogs/wang-zhan-da-jian/2022/da-jian-bo-ke-yi.html#三、-自定义网站配置" class="sidebar-link reco-side-三、-自定义网站配置" data-v-cb1513f6>三、 自定义网站配置</a></li><li class="level-2" data-v-cb1513f6><a href="/./blogs/wang-zhan-da-jian/2022/da-jian-bo-ke-yi.html#四、自定义首页配置" class="sidebar-link reco-side-四、自定义首页配置" data-v-cb1513f6>四、自定义首页配置</a></li><li class="level-2" data-v-cb1513f6><a href="/./blogs/wang-zhan-da-jian/2022/da-jian-bo-ke-yi.html#参考资料" class="sidebar-link reco-side-参考资料" data-v-cb1513f6>参考资料</a></li></ul></main> <!----></div></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;display:none;" data-v-c6073ba8 data-v-c6073ba8><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-c6073ba8><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-c6073ba8></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-c6073ba8></path></svg></div></div></div>
    <script src="./assets/js/app.eeeee38d.js" defer></script><script src="./assets/js/3.58d0d062.js" defer></script><script src="./assets/js/1.cb177be2.js" defer></script><script src="./assets/js/12.a8ba3e88.js" defer></script>
  </body>
</html>
